Skip to content

Conversation

@mfahampshire
Copy link
Contributor

@mfahampshire mfahampshire commented Oct 17, 2025

This PR grew a bit, it includes:

  • a TcpSocket-like abstraction for the Rust SDK (utilising AsyncRead/AsyncWrite traits)
  • an abstraction built on top of this, which allows for the SDK to use Exit Gateway's IPRs
  • the proof of concept for mixtcp, a smoltcp device that uses the IPR abstraction for transport. this proof of concept has several example files showing how it can be used for HTTPS requests and doing TLS handshakes via the Mixnet.

Documentation will be done in a separate PR.

ToDo:

  • rebase with develop

This change is Reviewable

@mfahampshire mfahampshire marked this pull request as draft October 17, 2025 14:00
@vercel
Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nym-explorer-v2 Ready Ready Preview Comment Oct 30, 2025 6:54pm
nym-node-status Ready Ready Preview Comment Oct 30, 2025 6:54pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs-nextra Ignored Ignored Preview Oct 30, 2025 6:54pm

@jstuczyn
Copy link
Contributor

you might want to rebase it first : )

Copy link
Contributor

@jstuczyn jstuczyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't got very deep into the actual mixtcp implementation, since you've had Drazen help you with that and because there was quite a lot of code to go through.

I will definitely have a second pass on it all later

@@ -1,3 +1,4 @@
#![allow(deprecated)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for the reference, what's deprecated there?

Copy link
Contributor Author

@mfahampshire mfahampshire Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it removes the clippy err for: warning: use of deprecated associated function nym_crypto::generic_array::GenericArray::<T, N>::clone_from_slice: please upgrade to generic-array 1.x - I will add in a comment on the allow(deprecated)s what is being ignored. Followed Drazen's advice to ignore instead of start messing with the crypto crate on this PR.

// Copyright 2022 - Nym Technologies SA <[email protected]>
// SPDX-License-Identifier: Apache-2.0

#![allow(deprecated)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for the reference, what's deprecated there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to stop putting this under every single instance. this comment applies to all of those : )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the compiler warning (that becomes a clippy err) that each of these fixes to the ones i've added in this PR

}

/**
* Functions below are from the nym-connection-monitor crate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, couldn't we just use the crate directly (since it's in the monorepo) rather than duplicating the non-trivial code?

}

pub async fn handle_reconstructed_message(
&mut self,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it need to be mutable given IprListener literally doesn't have anything on it?

pub fn rx_receiver(&self) -> mpsc::UnboundedReceiver<Vec<u8>> {
// Create a new channel and return the receiver
// This is a bit of a hack but necessary for the current architecture
let (_tx, rx) = mpsc::unbounded_channel();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait. what's the point of a channel that's immediately getting closed?

let proto = packet[9];
let src_ip = &packet[12..16];
let dst_ip = &packet[16..20];
info!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be info log?

info!(
"Outgoing IPv{} packet: proto={}, src={}.{}.{}.{}, dst={}.{}.{}.{}",
version, proto,
src_ip[0], src_ip[1], src_ip[2], src_ip[3],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, those logs will only work if it's an ipv4 packet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants